import http from "@/utils/http";


/**
 * 品牌查看
 * @returns
 */
export function getBrandAPI(params) {
    return http.post(`/brand/getBrand`,params);
}

/**
 * 添加品牌
 * @param {object} params BrandRequest
 * @param {number} params.categoryId
 * @param {string} params.name
 * @param {string} params.nameEn
 * @param {string} params.logo
 * @param {string} params.country
 * @param {string} params.des
 * @param {string} params.foundedTime
 * @returns
 */
export function addBrandAPI(params) {
    return http.post(`/brand/add`, params);
}

/**
 * 修改品牌
 * @param {object} params BrandRequest
 * @param {number} params.id
 * @param {number} params.categoryId
 * @param {string} params.name
 * @param {string} params.nameEn
 * @param {string} params.logo
 * @param {string} params.country
 * @param {string} params.des
 * @param {string} params.foundedTime
 * @returns
 */
export function updateBasicAPI(params) {
    return http.put(`/brand/update`, params);
}

/**
 * 删除品牌
 * @param {{id}} id
 * @returns
 */
export function deleteBrandAPI(id) {
    return http.delete(`/brand/${id}`);
}

/**
 * 通过分类id获取品牌信息
 * @param {string} cateId
 * @returns
 */
export function getBrandByCateId(cateId) {
    return http.get(`/brand/get/${cateId}`);
}